package com.examples.chartdirector.ui;

import java.awt.Component;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

import com.examples.chartdirector.FinancialCharts.model.ISelectedItem;

public class DefaultComboBoxItemRenderer<T extends ISelectedItem> extends DefaultListCellRenderer {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1323168167317842483L;
	public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        String text = ((ISelectedItem) value).getName();
        return super.getListCellRendererComponent(list, text, index, isSelected, cellHasFocus);
    }

}
